package ar.edu.sccs.model.cbr;

import org.apache.log4j.Logger;

import ar.edu.sccs.dao.DaoModule;
import ar.edu.sccs.entities.Case;
import ar.edu.sccs.monitoring.exception.SccsGenericException;

public class FeedbackModule {

	static Logger logger = Logger.getLogger(FeedbackModule.class);

	private DaoModule daoModule = new DaoModule();

	public Case evaluateCode(Case targetCase, Case selectedCase) throws SccsGenericException {
		logger.info("FeedbackModule.evaluateCode");
		targetCase.setScmUrl(selectedCase.getScmUrl());

		// // Le asigno al caso base "targetCase" la similitud de
		// correspondiente al caso recuperado de la DB
		// for (Iterator<String> keys =
		// selectedCase.getDimensions().keySet().iterator(); keys.hasNext();) {
		// String key = keys.next();
		// Dimension dim = selectedCase.getDimensions().get(key);
		//
		// if (targetCase.getDimension(key) != null)
		// targetCase.getDimension(key).setSimilarity(dim.getSimilarity());
		// }

		daoModule.loadCase(targetCase);
		return targetCase;
	}

}
